//
//  MeVCTbvTypeCell.m
//  ZITHER
//
//  Created by weixin on 2019/1/5.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "MeVCTbvTypeCell.h"

@implementation MeVCTbvTypeCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    //    [self.title setCornerRadiusWithRadius:8 isMasks:YES];
    //    [self.title setBorderWithColor:[UIColor colorWithHex:@"333333"] width:1];
    self.backgroundColor = HexColor(0xf5f5f5);

    if ([Main_Token_Model_MANAGER.isToken isEqualToString:@"1"]){
        BaseView *view =[[BaseView alloc]initWithFrame:CGRectMake(0, 0, kScreenW, 50)];
        view.backgroundColor = RGB(51, 51, 51);
        [self addSubview:view];
    }
    
    [self addSubview:self.shadowView];
    [self.shadowView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.right.equalTo(self).offset(-15);
        make.top.equalTo(self).offset(15);
        make.bottom.equalTo(self).offset(-10);
        make.height.mas_equalTo(90);
    }];
    
    
    
    [[self.shadowView.btnPackUp addTag]subscribeNext:^(id  _Nullable x) {
        self.shadowView.btnPackUp.selected = !self.shadowView.btnPackUp.selected;
        if (self.shadowView.btnPackUp.selected) {
            [self.shadowView mas_updateConstraints:^(MASConstraintMaker *make) {
                make.height.mas_equalTo(140);
            }];
        }else{
            [self.shadowView mas_updateConstraints:^(MASConstraintMaker *make) {
                make.height.mas_equalTo(90);
            }];
        }
        [self.shadowView viewWithTag:104].hidden = ![self.shadowView viewWithTag:104].hidden;
        if (self.blockTag) {
            self.blockTag();
        }
    }];
}


-(MeVCTbvTypeCellView *)shadowView{
    if (!_shadowView) {
        _shadowView = [[MeVCTbvTypeCellView alloc]initWithFrame:CGRectMake(0, 0, 0, 0 )];
    }
    return _shadowView;
}
//- (void)setIndex:(NSInteger)index{
//    switch (index) {
//        case 0:
//            self.title.text = @"我的创作";
//            break;
//        case 1:
//            self.title.text = @"我的关注";
//            break;
//        case 2:
//            self.title.text = @"我的点赞";
//            break;
//        default:
//            break;
//    }
//}


@end
